<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
    </head>
    <body>
        <h1>Bai 4</h1>
        <?php 
        // bai 4
        $a1=  rand(-200, 200);
        $b1=  rand(-200, 200);
        $c1= rand(-200, 200);
        if($a1>0 && $b1>0 && $c1>0)
        {if($a1+$b1>$c1 && $a1+$c1>$b1 && $b1+$c1>$a1)
        {
        echo "Day la 3 canh cua tam giac" ;
        }
        }
        if ($a1<0 && $b1<0 && $c1>0)
        {
                        echo"Day la tich a,c". $a1*$c1;
        }
        if ($a1<0)
        {if($b1>0 && $b1<$c1)
        {echo  ("day la tich a,b,c". $a1*$b1*$c1);
        }
        {if($b1<0)
        {
        echo "a= ".$a1 ."b= ".$b1 ."c= ".$c1;
        }
        }
        }
        ?>
        <h1> Bai 5 </h1>
        <?php 
        $a2=  rand(-2000, 4000);
        $b2= rand(-2000, 4000) ;
        $c2=  rand(-2000, 4000);
        $d2=  rand(-2000, 4000);
        echo "bien a= ".$a2. "bien b= ".$b2." Bien c= ".$c2. " bien d=". $d2 ;
        if(a>0)
        {
            for ($i=1; $i<$a2;$i++ )
            {
                echo "giai thua  ". $i*$a2  ;
        }  
        }
        if ($b2>0)
        {
            echo "so b= " .$b2  ." Binh phuong cua b la  ".$b2*$b2;
        }
        if($c2>0 && $d2<0)
        {
            echo "tich c,d".$c2*$d2;
        }
 else {
            echo "thuong cua c,d ".$c2/$d2;
 }
                ?>
        <h1> Bai 6 </h1>
        <?php 
        $contry="vn";
        switch ($contry)
        {
            case "ca":echo "hello Canada'<br>'"; break;
            case "vn":echo "Toi yeu Viet nam'<br>'";break;
            Case "usa":echo "Hello Mi~'<br>'";break;
            case "Y":echo "hello Ytalia'<br>'"; break;
            case "mi":echo "hello Mianma'<br>'";break;
            Case "phi":echo "Hello Philippin'<br>'";break;
            case "tq":echo "hello Tau khua '<br>'"; break;
            case "au":echo "hello Ut '<br>'";break;
            Case "tha":echo "Hello Thai Lan";break;
            case "lao":echo "hello Lao'<br>'"; break;
            case "an":echo "hello An Do.'<br>";break;
            Case "du":echo "Hello Duc~'<br>'";break;
            case "Nhat":echo "hello Nhat'<br>'"; break;
            case "ph":echo "hello Viet Phap'<br>'";break;
            Case "anh":echo "Hello Anh'<br>'";break;
            
            
        }
        
        if($contry=="")
        {
        echo "I love  Canada";
       }
 else if($contry=="ph" && $contry=="anh" && $contry=="au")
 {
           echo "toi chua den nuoc cua ban ";         
       }
 else {
      echo  "good bey"    ;
       }
        ?>
        <h1> Bai 7 </h1>
        <?php 
        for ($k=1;$k<=100;$k++) 
        {
            echo $k/=3==3;
        }
        ?>
        <?php
        $i=1;
        while ($i<=100)
         
       {
            echo $i/=3==0; 
       }         
           $i++;
        ?>
        
       
        
    </body>
</html>
